C (178/301)

From:Ben Hutchings
Date:29 Aug 99 at 21:13:52
Subject:Re: Re: ExecBase & 'RESET:starting PC' exception

From: Ben Hutchings <womble@zzumbouk.demon.co.uk>

On Sun, Aug 29, 1999 at 03:55:45AM +0200, Volker Barthelmann wrote:
> From: Volker Barthelmann <volker@vb.franken.de>
>
>
>
> On Sat, 28 Aug 1999, Ben Hutchings wrote:
>
> > > > String literals are arrays of const char.
> > > >
> > > First I've heard of it.
> >
> > You doubt what I say? Perhaps you should find some decent
> > documentation on standard C or C++.
> >
> > For hysterical raisins, you are allowed to assign string literals to
> > objects of type char *. That's just a special case; it doesn't mean
> > that they are really arrays of char.
>
> If you're talking about the type of string literals, than (at least in C -
> not sure about C++) they definitely are arrays of char, not arrays of
> const char.

In C++ they are definitely arrays of const char (see Stroustrup 3rd
edition section 5.2.2 or the standard section 2.13.4 (I think)). But
I should not have included C above.

> You're not allowed to modify them, but that's something different. There
> is no special case regarding their type or rules for assignment.

Yes, I understand that const-ness and constant storage aren't quite
the same thing.



Ben Hutchings - womble@zzumbouk.demon.co.uk, http://www.zzumbouk.demon.co.uk
Team *AMIGA* | Jay Miner Society | Linux - the choice of a GNU generation
It's easier to fight for one's principles than to live up to them.